<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>Z+ Blog - 注册</title>

    <!--<link rel="shortcut icon" href="favicon.ico"> -->
    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/css/animate.min.css" rel="stylesheet">
    <link href="/css/style.min.css?v=4.1.0" rel="stylesheet">
    <script>if (window.top !== window.self) {
        window.top.location = window.location;
    }</script>

</head>

<body class="gray-bg">

<div class="middle-box text-center loginscreen   animated fadeInDown">
    <div>
        <div>

            <h1 class="logo-name">Z+</h1>

        </div>
        <h3>欢迎注册 Z+</h3>
        <p>创建一个Z+新账户</p>
        <form class="m-t">
            <div class="form-group">
                <input type="text" id="user_phone" class="form-control" placeholder="请输入手机号" required="">
            </div>
            <div class="form-group">
                <input type="password" id="user_pwd" class="form-control" placeholder="请输入密码" required="">
            </div>
            <div class="form-group">
                <input type="password" id="user_repwd" class="form-control" placeholder="请再次输入密码" required="">
            </div>
            <div class="form-group text-left">
                <label class="no-padding"> <input type="checkbox"> <i></i> 我同意注册协议</label>
            </div>
            <button type="submit" class="btn btn-primary block full-width m-b" onclick="register()">注 册</button>

            <p class="text-muted text-center">
                <small>已经有账户了？</small>
                <a href="login.html">点此登录</a>
            </p>

        </form>
    </div>
</div>
<script src="/js/jquery.min.js?v=2.1.4"></script>
<script src="/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/js/plugins/iCheck/icheck.min.js"></script>
<script>
    function register() {
        var user_phone = $("#user_phone").val();
        var user_pwd = $("#user_pwd").val();

        $.ajax({
            type: "POST",
            url: "/user_register",
            data: {user_phone: user_phone, user_pwd: user_pwd},
            datatype: "text",
            async: false,
            success: function () {
                alert("register success");
                /*注册成功直接跳转,当前窗口*/
                window.open("/index");
            },
            error: function () {
                alert("注册失败");
            }
        });
    }
</script>
</body>

</html>
